package com.infore.statisticsAndAlarm.entity;

import java.io.Serializable;
import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;


/**
 * The persistent class for the KNOWLEDGE_BASE database table.
 * 数据库存储文件类
 */
@NamedEntityGraph(name="KnowledgeBase_view",
attributeNodes={
	@NamedAttributeNode("fileType"),
}
)
@Entity
@Table(name="KNOWLEDGE_BASE")
@NamedQuery(name="KnowledgeBase.findAll", query="SELECT k FROM KnowledgeBase k")
public class KnowledgeBase implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="KNOWLEDGE_BASE_ID")
	@GeneratedValue(generator = "uuidGenerator")
	@GenericGenerator(name = "uuidGenerator", strategy = "uuid") // UUID生成策略
	private String knowledgeBaseId;

	/**文件简述**/
	@Column(name="FILE_DESCRIBE")
	private String fileDescribe;

	/**文件名称**/
	@Column(name="FILE_NAME")
	private String fileName;

	/**文件浏览次数**/
	@Column(name="FILE_NUM")
	private String fileNum;

	/**文件发布时间**/
	@Temporal(TemporalType.TIMESTAMP)
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") 
	@Column(name="FILE_PUBLISH_TIME")
	private Date filePublishTime;

	/**文件类型**/
	@ManyToOne
	@JoinColumn(name = "FILE_TYPE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	private FileType fileType = new FileType();

	/**知识库类型**/
	@Column(name="KNOWLEDGE_TYPE")
	private String knowledgeType;

	public KnowledgeBase() {
	}

	public String getKnowledgeBaseId() {
		return this.knowledgeBaseId;
	}

	public void setKnowledgeBaseId(String knowledgeBaseId) {
		this.knowledgeBaseId = knowledgeBaseId;
	}

	public String getFileDescribe() {
		return this.fileDescribe;
	}

	public void setFileDescribe(String fileDescribe) {
		this.fileDescribe = fileDescribe;
	}

	public String getFileName() {
		return this.fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFileNum() {
		return this.fileNum;
	}

	public void setFileNum(String fileNum) {
		this.fileNum = fileNum;
	}

	public Date getFilePublishTime() {
		return this.filePublishTime;
	}

	public void setFilePublishTime(Date filePublishTime) {
		this.filePublishTime = filePublishTime;
	}

	public String getKnowledgeType() {
		return this.knowledgeType;
	}

	public void setKnowledgeType(String knowledgeType) {
		this.knowledgeType = knowledgeType;
	}

	public FileType getFileType() {
		return fileType;
	}

	public void setFileType(FileType fileType) {
		this.fileType = fileType;
	}

}